package remote.containers
{
	import remote.geom.Size;
	import remote.layouts.VerticalLayout;
	
	/**
	 * 无外观的竖起布局容器
	 * @author 银魂飞雪
	 * @createDate 2011-3-6
	 */
	public class VGroup extends Group
	{
		public function VGroup()
		{
			super();
		}
		/**
		 * @inheritDoc 
		 * 
		 */	
		override public function updateSize():void
		{
			var oldSize:Size = new Size(width, height);
			super.updateSize();
			if(!oldSize.equal(new Size(width, height)))		//如果中间对齐，或者右对齐，则尺寸变化，需要更新布局
				this.updateLayout();
		}
		/**
		 * @inheritDoc 
		 * 
		 */	
		override protected function createLayout():void
		{
			_layout = new VerticalLayout(this);
		}
		
		/**
		 * 竖直方向对齐方式
		 * 
		 */		
		public function get valgin():String
		{
			return (_layout as VerticalLayout).valgin;
		}
		
		public function set valgin(value:String):void
		{
			(_layout as VerticalLayout).valgin = value;
			this.updateSize();
		}
		
		/**
		 * 水平方向对齐方式
		 * 
		 */		
		public function get halgin():String
		{
			return (_layout as VerticalLayout).halgin;
		}
		
		public function set halgin(value:String):void
		{
			(_layout as VerticalLayout).halgin = value;
			this.updateSize();
		}
		

		/**
		 * 子项之间的间隔
		 * 
		 */		
		public function get gap():Number
		{
			return (_layout as VerticalLayout).gap;
		}		
		public function set gap(value:Number):void
		{
			(_layout as VerticalLayout).gap = value;
			this.updateSize();
		}
	}
}